package fjut.acm.coding.service.Impl;

import fjut.acm.coding.entity.ProblemSample;
import fjut.acm.coding.mapper.ProblemSampleMapper;
import fjut.acm.coding.service.ProblemSampleService;
import org.springframework.stereotype.Service;
import tk.mybatis.mapper.entity.Example;

import javax.annotation.Resource;
import java.util.List;


@Service
public class ProblemSampleServiceImpl implements ProblemSampleService {
    @Resource
    ProblemSampleMapper problemSampleMapper;

    @Override
    public List<ProblemSample> selectSamples(Integer problemId) {
        Example example = new Example(ProblemSample.class);
        example.createCriteria().andEqualTo("problemId", problemId);
        return problemSampleMapper.selectByExample(example);
    }
}
